local weimu = fk.CreateSkill {
  name = "lvshi__weimu",
  tags = {"Round"}
}

Fk:loadTranslationTable{
  ["lvshi__weimu"] = "帷幕",
  [":lvshi__weimu"] = "轮次技，你或己方角色成为黑色锦囊牌的目标后，你可令此牌对其无效，若为你，重置此技能。",
  ["#ls__weimu-invoke"] = "帷幕：你可令%arg对%dest无效",

  ["$lvshi__weimu1"] = "施经布略由我，剩下的，任由将军！",
  ["$lvshi__weimu2"] = "兵以诈立，不如，任其来攻！",
}

local ls = require "packages/lvshi/utility"

weimu:addEffect(fk.TargetConfirmed,{
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(weimu.name) and data.card.type == Card.TypeTrick and data.card.color == Card.Black
    and player:usedSkillTimes(weimu.name, Player.HistoryRound) == 0 and (ls.isFriend(player, target) or player == target)
  end,
  on_cost = function(self, event, target, player, data)
    return player.room:askToSkillInvoke(player, { skill_name = weimu.name,
    prompt = "#ls__weimu-invoke::"..target.id..":"..data.card:toLogString()})
  end,
  on_use = function(self, event, target, player, data)
    data.use.nullifiedTargets = data.use.nullifiedTargets or {}
    table.insertIfNeed(data.use.nullifiedTargets, target)
    if target == player then
      player:setSkillUseHistory(weimu.name, 0, Player.HistoryRound)
    end
  end,
})


return weimu